package com.springcloud.controller;

import com.springcloud.pojo.payment;
import com.springcloud.service.IPaymentService;
import cxt.com.springcloud.pojo.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: ChengXiaotian
 * @Date: 2020-06-08 15:01
 * @Description:
 */
@RestController
@Slf4j
public class paymentController {
    @Autowired
    private IPaymentService paymentService;
    @GetMapping("/payment/{id}")
    public CommonResult findById(@PathVariable("id")Long id){
        payment byId = paymentService.findById(id);
        if(byId==null){
            return new CommonResult<>(404,"没找到");
        }
        return new CommonResult<>(200,"找到了",byId);
    }
}
